<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <title>initSession</title>
	
	<link href="../component/bootstrap/bootstrap.min.css" rel="stylesheet">
	<link href="../css/font-awesome.min.css" rel="stylesheet" type="text/css" >
	
	<script src="../js/jquery.min.js"></script>
	<script src="../component/bootstrap/bootstrap.min.js"></script>
    
    <script>
		
    </script>
</head>
<body>

<div class="container" style="margin-top:10px;height:300px;width:65%;">
	<div class="row" style="margin-top:5px;">
		<div class="col-md-12">
			<div class="input-group">
			  <span class="input-group-addon" id="basic-addon1">连接名</span>
			  <input type="text" id="connectName" name="connectName" value="新建连接" class="form-control" aria-describedby="basic-addon1">
			</div>
		</div>
		<div class="col-md-12">
			<div class="input-group">
			  <input type="hidden" value="connect" id="operate" name="operate">
			  <span class="input-group-addon" id="basic-addon1">主机IP</span>
			  <input type="text" id="host" name="host" value="121.36.73.183" class="form-control" aria-describedby="basic-addon1">
			</div>
		</div>
		<div class="col-md-12">
			<div class="input-group">
			  <span class="input-group-addon" id="basic-addon1">端口号</span>
			  <input type="text" id="port" name="port" value="22" class="form-control" aria-describedby="basic-addon1">
			</div>
		</div>
		<div class="col-md-12">
			<div class="input-group">
			  <span class="input-group-addon" id="basic-addon1">用户名</span>
			  <input type="text" id="username" name="username" value="root" class="form-control" aria-describedby="basic-addon1">
			</div>
		</div>
		<div class="col-md-12">
			<div class="input-group">
			  <span class="input-group-addon" id="basic-addon1">密&emsp;码</span>
			  <input type="password" id="password" name="password" value="Zw55350002" class="form-control" aria-describedby="basic-addon1">
			</div>
		</div>
	</div>
	<div class="row" style="margin-top:30px;text-align: center;">
		<div class="btn-group" role="group">
		  <button type="button" class="btn btn-primary" onclick="connect();">连接</button>
		  <button type="button" class="btn btn-default">取消</button>
		</div>
	</div>
</div>
<script>
	function connect(){
		var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
	    parent.layer.close(index);
		var param = {
			"connectName" : $("#connectName").val(),
			"host" : $("#host").val(),
			"port" : $("#port").val(),
			"username" : $("#username").val(),
			"password" : $("#password").val(),
		}
		parent.tools.createSession(param);
	}
</script>
</body>
</html>